package com.sqstudio.control
{
	import com.sqstudio.common.LunarCalendar;
	import com.sqstudio.common.Sys;
	import com.sqstudio.event.CalendarEvent;
	import com.sqstudio.model.Model;
	import com.sqstudio.view.YiJiPanel;
	
	import flash.events.Event;

	public class YiJiController
	{
		private var _yijiPanel:YiJiPanel;
		public function YiJiController()
		{
			
			this._yijiPanel = new YiJiPanel();
			Sys.STAGE.addChild(this._yijiPanel);
			this._yijiPanel.x = 414;
			this._yijiPanel.y = 328;
			CalendarEvent.Dispatcher.addEventListener(CalendarEvent.DATE_CHANGE,dateChangeHandler);
		}
		
		private function dateChangeHandler(e:Event):void
		{
			var dataArr:Array = LunarCalendar.getTaoo(Model.CrtDate);
			this._yijiPanel.updateYiJiName(dataArr);
		}
	}
}